<?php 
if($type == 'sent')
{
	$headerUserToShow = 'Recipient';
	$userId = 'recipient_id';
	$username = 'recipient_username'; 
} else {
	$headerUserToShow = 'Sender';
	$userId = 'sender_id';
	$username = 'sender_username';
	
}
?>
<div class="messages index">
<p>
	<?php echo __("Subject")?> : <b><?php echo $message['Message']['subject']; ?></b>
	<br />
	<?php if($type == 'inbox')
	{?>
		<?php echo __("Sender")?> : <?php echo $html->link($message['Message'][$username],'/users/profile/'.$message['Message'][$userId].'/'.Inflector::slug($message['Message'][$username],'-'));?>, <?php echo __('on')?> <?php echo $time->nice($message['Message']['created']); ?>
	<?php } else { ?>
		<?php echo __("Recipient")?> : <?php echo $html->link(ucfirst($message['Message'][$username]),'/users/profile/'.$message['Message'][$userId].'/'.Inflector::slug($message['Message'][$username],'-'));?>, <?php echo __('on')?> <?php echo $time->nice($message['Message']['created']); ?>	
	<?php } ?>
	<?php if(isset($message['Attachment']['file_url']))
	{ ?><br />
		<?php echo __("Attachment")?>: 
			<?php echo $html->link($message['Attachment']['name'],$message['Attachment']['file_url'])?>
	<?php } ?>
	<br />
	<?php echo __("Message Body")?> :
	<?php echo $message['Message']['body']; ?>
</p>
<div id="pageTop">
	<?php echo $this->element('messagesTop',array('plugin'=>'messages'));?>
	<?php if($type=='inbox') {?>
		<?php echo $html->link(__('Reply'),array('controller'=>'messages','action'=>'send',$message['Message']['sender_id'],'User'),array('class'=>'action_link'))."<br />";?>
	<?php }?>
</div>
</div>